import java.io.Serializable;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

class Employee implements Serializable
	{
	public String name;
	public String address;
	public transient int SSN;
	public int number;
	
	public void mailCheck()
		{
		System.out.println("Mailing a check to " + name + " " + address) ;
		}
	}
	
class SerializationDemo
	{
	public static void main(String args[])	
		{
		Employee e = new Employee();
		e.name = "Subrat";
		e.address = "Bangalore";
		e.SSN = 123;
		e.number = 1;
		
		try
			{
			FileOutputStream fout = new FileOutputStream("employee.ser");
			ObjectOutputStream out = new ObjectOutputStream(fout);
			out.writeObject(e);
			out.close();
			fout.close();
			}
		catch(IOException i)
			{
			i.printStackTrace();
			}
		}
	}